package com.wxy.demo.design_pattern.method_factory;

/**
 * <p>
 *
 * </p>
 *
 * @author e-Xiaoyuan.Wang
 * @since 2022/11/4 10:23
 */
public class FactoryProvider {
    CoffeeFactory getFactory(String type) {
        if (type.equalsIgnoreCase("American")) {
            return new AmericanCoffeeFactory();
        } else if (type.equalsIgnoreCase("Latte")) {
            return new LatteCoffeeFactory();
        }
        return null;
    }
}
